#include <stdio.h>
#include <stdlib.h>

int num;

void switch_statement(int num);
void if_statement(int num);

void main(void)
{
    

    printf("Please input a number: ");
    scanf("%d", &num);
    (num%2==0)? printf("even\n"): printf("odd\n");
    switch_statement(num);
    if_statement(num);
    system("pause");
}



/*
C 语言把任何非零和非空的值假定为 true，把零或 null 假定为 false


*/

void switch_statement(int num)
{
    switch (num)
    {
        case 1:
            printf("switch %d.\n", num);
            break;
        case 2:
            printf("switch %d.\n", num);
            break;
        default:
            printf("switch default %d.\n", num);
            break;
    }
}


void if_statement(int num)
{
    if (num == 1)
    {
        printf("if %d.\n", num);
    }
    else if (num==2)
    {
        printf("if %d.\n", num);
    }
    else
    {
        printf("if else %d.\n");
    }
}